trait Pilot {
    fn fly(&mut self);
}

trait Wizard {
    fn fly(&mut self);
}

struct Human {
    first_name: String,
}

impl Pilot for Human {
    fn fly(&mut self) {
        self.first_name = "机长".to_string();
        println!("{} say:This is your captain speaking.", self.first_name);
    }
}

impl Wizard for Human {
    fn fly(&mut self) {
        self.first_name = "鸟人".to_string();
        println!("{} say: Up!", self.first_name);
    }
}

impl Human {
    fn fly(&mut self) {
        self.first_name = "超人".to_string();
        println!("{} say: *waving arms furiously*", self.first_name);
    }
}

trait Animal {
    fn baby_name() -> String;
}

struct Dog;

impl Dog {
    fn baby_name() -> String {
        String::from("Spot")
    }
}

impl Animal for Dog {
    fn baby_name() -> String {
        String::from("puppy")
    }
}

fn main() {
    let mut person = Human {
        first_name: "".to_string(),
    };
    Pilot::fly(&mut person);
    Wizard::fly(&mut person);
    person.fly();
    println!("A baby dog is called a {}", <Dog as Animal>::baby_name());
}
